package com.siwei.mes.entity.tgl;

import com.siwei.mes.common.validator.bus.SyncGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;


/**
 * TGL-合同(Contract)实体类
 *
 * @author linzi
 * @since 2023-12-06 20:54:44
 */
@Data
@Accessors(chain = true)
@Table(name = "tgl_contract")
@ApiModel(value = "TglContract", description = "TGL-合同")
public class TglContract implements Serializable {
    private static final long serialVersionUID = 260244482966309119L;

    /**
     * 主键id
     */
    @Id
    @ApiModelProperty(value = "TGL-合同主键ID", name = "id")
    private Long id;

    /**
     * 合同id
     */
    @Column(name = "CID")
    @ApiModelProperty(value = "合同id", name = "cid")
    private Long cid;
    /**
     * 客户id
     */
    @Column(name = "CUSID")
    @ApiModelProperty(value = "客户id", name = "cusid")
    private Integer cusid;
    /**
     * 客户名称
     */
    @Column(name = "customerName")
    @ApiModelProperty(value = "客户名称", name = "customername")
    private String customerName;
    /**
     * 合同编号
     */
    @Column(name = "contractNo")
    @ApiModelProperty(value = "合同编号", name = "contractno")
    private String contractNo;
    /**
     * 信用等级
     */
    @Column(name = "level")
    @ApiModelProperty(value = "信用等级", name = "level")
    private String level;
    /**
     * 类型 1 普通合同 2电子合同
     */
    @Column(name = "type")
    @ApiModelProperty(value = "类型 1 普通合同 2电子合同", name = "type")
    private Integer type;
    /**
     * 1-正式合同 3-临时合同 4-垫资合同 5-月结合同 6-现金合同 7-关系合同
     */
    @Column(name = "subType")
    @ApiModelProperty(value = "1-正式合同 3-临时合同 4-垫资合同 5-月结合同 6-现金合同 7-关系合同", name = "subtype")
    private Integer subType;
    /**
     * 授信金额
     */
    @Column(name = "creditAmount")
    @ApiModelProperty(value = "授信金额", name = "creditamount")
    private Long creditAmount;
    /**
     * 销售金额
     */
    @Column(name = "salesAmount")
    @ApiModelProperty(value = "销售金额", name = "salesamount")
    private Long salesAmount;
    /**
     * 结算金额
     */
    @Column(name = "settlementAmout")
    @ApiModelProperty(value = "结算金额", name = "settlementamout")
    private Long settlementAmout;
    /**
     * 授信方量
     */
    @Column(name = "creditQuantity")
    @ApiModelProperty(value = "授信方量", name = "creditquantity")
    private Float creditQuantity;
    /**
     * 供货单位
     */
    @Column(name = "deliverCompanyName")
    @ApiModelProperty(value = "供货单位", name = "delivercompanyname")
    private String deliverCompanyName;

    @Column(name = "tpz")
    private String tpz;
    /**
     * 签订日期
     */
    @Column(name = "signDate")
    @ApiModelProperty(value = "签订日期", name = "signdate")
    private Date signDate;
    /**
     * 下单开始时间1400
     */
    @Column(name = "orderStartTime")
    @ApiModelProperty(value = "下单开始时间1400", name = "orderstarttime")
    private String orderStartTime;
    /**
     * 下单结束时间2100
     */
    @Column(name = "orderEndTime")
    @ApiModelProperty(value = "下单结束时间2100", name = "orderendtime")
    private String orderEndTime;
    /**
     * 额外信息
     */
    @Column(name = "extraInfo")
    @ApiModelProperty(value = "额外信息", name = "extraInfo")
    private String extraInfo;
    /**
     * 合同联系人
     */
    @Column(name = "linkMan")
    @ApiModelProperty(value = "合同联系人", name = "linkman")
    private String linkMan;
    /**
     * 合同联系电话
     */
    @Column(name = "linkTel")
    @ApiModelProperty(value = "合同联系电话", name = "linktel")
    private String linkTel;
    /**
     * 合同照片
     */
    @Column(name = "imgs")
    @ApiModelProperty(value = "合同照片", name = "imgs")
    private String imgs;
    /**
     * 合同生效日期
     */
    @Column(name = "startDate")
    @ApiModelProperty(value = "合同生效日期", name = "startdate")
    private Date startDate;
    /**
     * 合同结束日期
     */
    @Column(name = "endDate")
    @ApiModelProperty(value = "合同结束日期", name = "enddate")
    private Date endDate;
    @Column(name = "createTime")
    private Date createTime;
    @Column(name = "updateTime")
    private Date updateTime;
    /**
     * 结算状态 1-未结算 2-已结算
     */
    @Column(name = "accountStatus")
    @ApiModelProperty(value = "结算状态 1-未结算 2-已结算", name = "accountstatus")
    private Integer accountStatus;
    /**
     * 同步时间戳
     */
    @Column(name = "synctime")
    @ApiModelProperty(value = "同步时间戳", name = "synctime")
    @NotNull(groups = {SyncGroup.class}, message = "同步时间戳为空")
    private Long synctime;

    /**
     * 合同名称
     */
    @Transient
    @ApiModelProperty(value = "合同名称", name = "contractName")
    private String contractName;
}
